using UnityEngine;
using System.Collections;

public class mainMenuUI : MonoBehaviour {

    public float buttonWidthPercent = 0.1f;
    public float buttonHeightPercent = 0.15f;
    public float percentSpacing = 0.02f;

    public float percentQuit = 0.05f;

    public Texture quitImage;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnGUI()
    {
        int xCenter = Screen.width / 2;
        int yCenter = Screen.height / 2;

        int xSpacing = (int)(percentSpacing * Screen.width);

        int buttonWidth = (int)(Screen.width * buttonWidthPercent);
        int buttonHeight = (int)(Screen.height * buttonHeightPercent);

        if (GUI.Button(new Rect(xCenter - (xSpacing / 2) - buttonWidth, yCenter - buttonHeight / 2, buttonWidth, buttonHeight), "Start"))
        {
            Application.LoadLevel("gameScene");
        }

        if (GUI.Button(new Rect(xCenter + (xSpacing / 2), yCenter - buttonHeight / 2, buttonWidth, buttonHeight), "Test"))
        {
            Application.LoadLevel("testScene");
        }

        if (!Application.isWebPlayer)
        {
            if (GUI.Button(new Rect(Screen.width - Screen.width * percentQuit - xSpacing, Screen.height * percentSpacing, Screen.width * percentQuit, Screen.width * percentQuit), new GUIContent(quitImage)))
            {
                Application.Quit();
            }
        }
    }


}
